package com.lunevich.json.common;

import com.lunevich.json.helpers.DownloadManager;
import com.lunevich.json.helpers.HttpManager;

import android.app.Application;

public class CustomApplication extends Application {
	
	private DownloadManager mImagedownloader;
	private HttpManager mHttpManager;
	
	@Override
	public void onCreate() {
		mImagedownloader = new DownloadManager();
		mHttpManager = new HttpManager();
	}
	
	@Override
	public Object getSystemService(String name) {
		if (name.equals(DownloadManager.IMAGE_DOWNLOADER)) {
			return mImagedownloader;
		}
		if (name.equals(HttpManager.HTTP_MANAGER)) {
			return mHttpManager;
		}
		return super.getSystemService(name);
	}
}